import numpy as np
import matplotlib.pyplot as plt
from math import ceil, floor, sqrt
from matplotlib import gridspec
from matplotlib import rcParams
rcParams['font.family'] = 'times new roman'

font = {'family' : 'times new roman',
        'weight' : 'normal',  
        'size'   : 15,  
        }

interval = 5
x1=[]
y1=[]
counter = 0
with open( "Jelly_out.txt", 'r') as f:
    for line in f.readlines():
    	split = line.split()
        counter += 1
    	if len(split)==4 and counter == interval:
            counter = 0
            x1.append(float(split[1]))
            y1.append(float(split[-1]))

x2=[]
y2=[]
with open( "OvS_out.txt", 'r') as f:
    for line in f.readlines():
        split = line.split()
        if len(split)==4:
            x2.append(float(split[1]))
            y2.append(float(split[-1]))

x3=[]
y3=[]
with open( "Detour_out.txt", 'r') as f:
    for line in f.readlines():
        split = line.split()
        if len(split)==4:
            x3.append(float(split[1]))
            y3.append(float(split[-1]))

lw = 0.9
ms = 6
#plt.plot(x1,y1, 'r')
plt.plot(x2,y2, color= 'b', ls='-', lw=lw, ms=ms, zorder=3)
plt.plot(x3,y3, color= 'y', ls='-', lw=lw, ms=ms, zorder=3)
plt.xlim(0, 0.2)
plt.grid()
plt.show()